window.error_alert=function(title,content)
{

	var dlg = $('<div id="ualertdlg"></div>');
	var content = $('<div class="content"></div>').append(content);
	var closeBtn = $('<button class="btn btn-large"><i class="fa fa-times"></i>&nbsp;Close</button>');
	dlg.append(content);
	dlg.append(closeBtn);

	dlg.dialog({
		modal:true,
		title:title,
		width:300,
		height:160,
		close:function(){
			dlg.remove();
		}
	});
	closeBtn.click(function(){dlg.dialog('close')});
	$('div[aria-describedby=ualertdlg]').addClass('err-dlg')
};

window.confirm_alert=function(title,content,onConfirm,onCancel){
	var dlg = $('<div id="ualertdlg"></div>');
	dlg.append(content);
	dlg.dialog({
		modal:true,
		title:title,
		width:400,
		height:160,
		close:function(){
			dlg.remove();
		}
	});
	dlg.dialog('option', 'title', title);
	dlg.dialog('option', 'buttons', {
            "Yes" : function(){
            	$(this).dialog("close");
            	onConfirm(dlg);
            },
            "No" : function() {
                $(this).dialog("close");
                onCancel(dlg);
            }});
	var yesBtn = dlg.parent().find('.ui-dialog-buttonset button:first');
	var noBtn = yesBtn.next();

	yesBtn.attr('class','btn btn-large');
	noBtn.attr('class','btn btn-large');

	yesBtn.html('<i class="fa fa-check"></i>&nbsp;Ok');
	noBtn.html('<i class="fa fa-times"></i>&nbsp;Cancel');

	yesBtn.unbind('mouseover');
	noBtn.unbind('mouseover');



 	dlg.dialog("open");
	$('div[aria-describedby=ualertdlg]').addClass('err-dlg');
};